<?php

if (isset($config)) {
	if (isset($_POST["page"])) {
		$loadTime = getTick();

		$page = $_POST["page"];
		
		$pageTitle = $config["page_title"] . " | Search for " . $page;
	
		$pageMenu = getPageContent($config["special_page_prefix"] . $config["menu_page"]);
		$pageSideMenu = getPageContent($config["special_page_prefix"] . $config["menu_side_page"]);	
		
		$pageContent = searchPage($page);
	
		$loadTime = getTick() - $loadTime;
		$pageInfo = formatPageInfo("", getPageDate($page), $loadTime);
	
		include(  $config["theme_dir"] . "/"
				. $config["theme"] . "/"
				. $config["theme_view"] . ".html" );		
	} else {
		redirectUrl("index.php");
	}
} else {
	include("function.php");
}

?>